<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>有两⽇期，⽐较两个⽇期是否相同</title>
</head>
<body>
    <script>
        var sak = new Date('2022/10/19');
        var arr = new Date();
        if(sak = arr){
            console.log('这两个日期相同');
        }else{
            console.log('这两个日期不相同');
        }
    </script>
</body>
</html>